home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Pointing.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
6KB
|
175 lines
{
File: Pointing.p
Contains: Pointer Family Interface
Version: Technology: Copland
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Pointing;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __POINTING__}
{$SETC __POINTING__ := 1}
{$I+}
{$SETC PointingIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __KERNEL__}
{$I Kernel.p}
{$ENDC}
{$IFC UNDEFINED __NAMEREGISTRY__}
{$I NameRegistry.p}
{$ENDC}
{$IFC UNDEFINED __TYPES__}
{$I Types.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{ *************** Constants *************** }
CONST
kAnyDeviceClass = 'anyp';
kMouseDeviceClass = 'mous';
kTabletDeviceClass = 'tblt';
kJoystickDeviceClass = 'joys';
kTrackballDeviceClass = 'trkb';
kTrackpadDeviceClass = 'trkp';
k3DTrackballDeviceClass = '3dtb';
kMinPTDataSize = 24;
kPointerFamilyError = -1;
kPTUnknownRegEntryRef = -2;
kPTInvalidTrackerRef = -3;
kPTMemoryAllocationFailed = -4;
kPTParamErr = -5;
TYPE
PTDataRelation = UInt16;
CONST
kAbsoluteData = 1;
kRelativeData = 2;
kAbsoluteOrRelativeData = 3;
{ *************** Public Data Structures *************** }
{ old name is TrackerID }
TYPE
PTTrackerRef = ^LONGINT;
PTButtonState = LONGINT;
PTButtonStatePtr = ^PTButtonState;
PTPositionPtr = ^PTPosition;
PTPosition = RECORD
x: LONGINT;
y: LONGINT;
z: LONGINT;
END;
{ old name is PointerData }
PTDataPtr = ^PTData;
PTData = RECORD
sequencingTag: AbsoluteTime;
position: PTPosition;
buttons: PTButtonState;
uniqueDeviceData: Ptr;
END;
PTDeviceModesPtr = ^PTDeviceModes;
PTDeviceModes = RECORD
relation: PTDataRelation;
uniqueDeviceModes: Ptr;
END;
PTDeviceClass = OSType;
PTDeviceIdentifierPtr = ^PTDeviceIdentifier;
PTDeviceIdentifier = RECORD
identifier: PACKED ARRAY [0..254] OF CHAR;
END;
PTDeviceCapabilitiesPtr = ^PTDeviceCapabilities;
PTDeviceCapabilities = RECORD
deviceClass: PTDeviceClass;
dataSize: ByteCount;
modeDataSize: ByteCount;
availableDataRelations: PTDataRelation;
defaultDataRelation: PTDataRelation;
latency: LONGINT;
imitatesMouse: BOOLEAN;
END;
PTPinningRectListPtr = ^PTPinningRectList;
PTPinningRectList = RECORD
numRects: INTEGER; { number of rects in list }
pinningRect: RectPtr; { pointer to a list of rects }
{ rects must be in global coordinates, in pixels }
END;
{ *************** Client Interfaces *************** }
{ *** Getting information about Devices *** }
FUNCTION PTGetNextDevice(VAR currentDevice: RegEntryRef; filter: PTDeviceClass; VAR nextDevice: RegEntryRefPtr): OSStatus; C;
FUNCTION PTGetDeviceCapabilities(VAR device: RegEntryRef; VAR capabilities: PTDeviceCapabilities): OSStatus; C;
FUNCTION PTGetDeviceIdentification(VAR device: RegEntryRef; VAR identification: PTDeviceIdentifier): OSStatus; C;
{ *** Setting Device Modes *** }
FUNCTION PTGetDeviceModes(VAR device: RegEntryRef; offset: ByteCount; numBytes: ByteCount; VAR modes: PTDeviceModes): OSStatus; C;
FUNCTION PTSetDeviceModes(VAR device: RegEntryRef; offset: ByteCount; numBytes: ByteCount; VAR modes: PTDeviceModes): OSStatus; C;
{ *** Registering with the Pointing Family *** }
{
PTRegisterNewTracker:
The client provides a reference to device she wants a connection with,
and whether buffered and/or static data are needed. A TrackerRef is
returned, which the client must use in all future communications with
the Pointing Family. In addition, the size of the PTData structure
that the given device generates is returned.
}
FUNCTION PTRegisterNewTracker(VAR device: RegEntryRef; bufferedData: BOOLEAN; stateData: BOOLEAN; VAR tracker: PTTrackerRef; VAR dataSize: ByteCount): OSStatus; C;
{ *** Maintaining Trackers *** }
FUNCTION PTSetPinningRects(tracker: PTTrackerRef; VAR rectList: PTPinningRectList): OSStatus; C;
{ *** Getting Data *** }
{ DataSize indicates the size of the buffer allocated by the client for dataPtr. }
FUNCTION PTGetTrackerData(tracker: PTTrackerRef; dataSize: ByteCount; VAR dataPtr: PTData): OSStatus; C;
FUNCTION PTFlushTrackerBuffer(tracker: PTTrackerRef): OSStatus; C;
{ *** Checking Tracker State *** }
FUNCTION PTGetPosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
FUNCTION PTSetPosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
FUNCTION PTMovePosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
FUNCTION PTGetButtons(tracker: PTTrackerRef; VAR buttons: PTButtonState): OSStatus; C;
FUNCTION PTSetButtons(tracker: PTTrackerRef; buttons: PTButtonState): OSStatus; C;
FUNCTION PTGetTrackerState(tracker: PTTrackerRef; dataSize: ByteCount; VAR data: PTData): OSStatus; C;
FUNCTION PTSetTrackerState(tracker: PTTrackerRef; dataSize: ByteCount; VAR data: PTData): OSStatus; C;
FUNCTION PTGetTrackerDataByOffset(tracker: PTTrackerRef; offset: ByteCount; numBytes: ByteCount; buffer: UNIV Ptr): OSStatus; C;
FUNCTION PTSetTrackerDataByOffset(tracker: PTTrackerRef; offset: ByteCount; numBytes: ByteCount; buffer: UNIV Ptr): OSStatus; C;
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := PointingIncludes}
{$ENDC} {__POINTING__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}